<?php
	require "../common/db.inc";
	$conn = new mysqli($host, $username, $password, $dbname);	
	$conn->query("set names 'utf8'");		
	//check connection
	if (mysqli_connect_errno()) {
		printf("Connect failed: %s\n", mysqli_connect_error());
		exit();
	}
	
	$id = $_GET["id"];
	$status = $_GET["status"];	
	$sql = "call sp_UpdateUserStatus($id, $status)";
	
	if(!$conn->query($sql))
	{
		echo "failed";
	}
	else
	{
		if($status == 0)
			echo "blocked";
		else
			echo "activated";
	}
	

?>